<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img{
            width: 300px;
        }
    </style>
</head>
<body>
    <img src="image/s.gif" alt="">
    <div>上午好</div>
    <script>
        /*
          根据不同的时间，显示不同的图片和文案。
        */
        var div = document.querySelector('div');
        var img = document.querySelector('img');

        var time = prompt("请问几点了");
        if(time < 12){
            div.innerHTML = "上午好";
            img.src = "image/s.gif";
        }
        if(time < 18 && time > 12){
            div.innerHTML = "下午好";
            img.scr = "imafes/x。gif";
        }
        if(time >= 18){
            div.innerHTML = "晚上好";
            img.src = "images/w.gif";
        }
    </script>
</body>
</html>